import { useState } from 'react'
import {Button} from 'antd'
import Context from './moneyContext'
import ContextChild from './contextchild'

const UseContext = () => {
  const [count, setCount] = useState(200)

  return (
    <>
      <Context.Provider value={{ money: count }}>
        <Button onClick={()=>setCount(count+100)}>赚一百块钱</Button>
        <ContextChild></ContextChild>
      </Context.Provider>
    </>
  )
}

export default UseContext
